package com.shop.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.ToString;

/**
 * 订单商品关联表 
 * 
 * @author yukangkang
 * @email sunlightcs@gmail.com
 * @date 2020-10-30 13:16:29
 */
@Data
@ToString
@TableName("order_items")
public class OrderItems implements Serializable {
	private static final long serialVersionUID = 1L;

		/**
		 * 主键id
		 */
		@TableId(value = ID)
		private String id;
		/**
		 * 归属订单id
		 */
		@TableField(ORDER_ID)
		private String orderId;
		/**
		 * 商品id
		 */
		@TableField(ITEM_ID)
		private String itemId;
		/**
		 * 商品图片
		 */
		@TableField(ITEM_IMG)
		private String itemImg;
		/**
		 * 商品名称
		 */
		@TableField(ITEM_NAME)
		private String itemName;
		/**
		 * 规格id
		 */
		@TableField(ITEM_SPEC_ID)
		private String itemSpecId;
		/**
		 * 规格名称
		 */
		@TableField(ITEM_SPEC_NAME)
		private String itemSpecName;
		/**
		 * 成交价格
		 */
		@TableField(PRICE)
		private Integer price;
		/**
		 * 购买数量
		 */
		@TableField(BUY_COUNTS)
		private Integer buyCounts;




	public final static String ID =  "`id`";
	public final static String ORDER_ID =  "`order_id`";
	public final static String ITEM_ID =  "`item_id`";
	public final static String ITEM_IMG =  "`item_img`";
	public final static String ITEM_NAME =  "`item_name`";
	public final static String ITEM_SPEC_ID =  "`item_spec_id`";
	public final static String ITEM_SPEC_NAME =  "`item_spec_name`";
	public final static String PRICE =  "`price`";
	public final static String BUY_COUNTS =  "`buy_counts`";


	public final static String ID_COMMENT =  "主键id";
	public final static String ORDER_ID_COMMENT =  "归属订单id";
	public final static String ITEM_ID_COMMENT =  "商品id";
	public final static String ITEM_IMG_COMMENT =  "商品图片";
	public final static String ITEM_NAME_COMMENT =  "商品名称";
	public final static String ITEM_SPEC_ID_COMMENT =  "规格id";
	public final static String ITEM_SPEC_NAME_COMMENT =  "规格名称";
	public final static String PRICE_COMMENT =  "成交价格";
	public final static String BUY_COUNTS_COMMENT =  "购买数量";


	public static OrderItems of(Object obj) {
		OrderItems e = new OrderItems();
		BeanUtils.copyProperties(obj, e);
		return e;
	}

	public static QueryWrapper<OrderItems> queryWrapper(Object obj) {
		return new QueryWrapper<>(of(obj));
	}



}
